#include<stdio.h>
#include<stdlib.h>

int sum(int n);

int main() {
	int result, i;
	for (i = 0; i <= 100; i++) {
		result = sum(i);
	}
	printf("1+2+3...+100 = %d\n", result);

	system("pause");
	return 0;
}

int sum(int n) {
	static int result = 0;
	result += n;

	return result;
}
